package com.zhijian.warehouse.manage.config;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

/**
 * @author HCG
 * @version 1.0
 * @date 2021/7/6
 */
public class Constants {

    /**
     * web端token的key
     */
    public static final String WEB_AUTHORIZATION = "webAuthorization";

    public static final String H5_AUTHORIZATION = "h5Authorization";

    /**
     * 小程序端token的key
     */
    public static final String MP_AUTHORIZATION = "mpAuthorization";

    /**
     * TOKEN访问密钥
     */
    public static final String TOKEN_ACCESS_KEY = "TPyz12zzqYhhzfdX";

    /**
     * TOKEN认证密钥
     */
    public static final String TOKEN_SECRET_KEY = "b&Hky7HSsiancM88ijsUUhjrf652g1fa";

    /**
     * 数字的默认显示值
     */
    public static final String NUMBER_NULL_VALUE = "--";

    /**
     * 用户登陆过期时间,默认2小时
     */
    public static final int LOGIN_EXPIRE_TIME = 60 * 60 * 2;

    public static final String ZH_CN = "zh-CN";

    public static final String EN = "en";

    /**
     * 系统名称
     */
    public static final String SYSTEM_NAME = "dms";

    public static final String OK = "合格";

    public static final String NG = "不合格";

    public static final String HEART_LEIYA = "heart_leiya";

    /**
     * web端拦截器排除路径
     */
    public static final List<String> WEB_TOKEN_EXCLUDE_PATHS = Arrays.asList("/mp/**",
            "/login",
            "/app/**",
            "/h5/**",
            "/mp/**",
            "/swagger-ui.html/**",
            "/swagger-resources/**",
            "/webjars/**",
            "/upload/file",
            "//b/mqtt/**",
            "/mqtt/**",
            "/tonglian/**",
            "/device/export/template",
            "/official/account/**",
            "/screen/**",
            "/v2/**"
            );

    /**
     * 小程序端拦截器排除路径
     */
    public static final List<String> MP_TOKEN_EXCLUDE_PATHS = Arrays.asList("/mp/login",
            "/mp/quick/login",
            "/mp/code",
            "/mp/valid");

    /**
     * APP端拦截器排除路径
     */
    public static final List<String> APP_TOKEN_EXCLUDE_PATHS = Arrays.asList("/app/login",
            "/app/code/login",
            "/app/code",
            "/app/login/qrcode",
            "/app/valid",
            "/app/office/group/list",
            "/app/register",
            "/mp/**"
            );
    /**
     * h5端拦截器排除路径
     */
    public static final List<String> H5_TOKEN_EXCLUDE_PATHS = Arrays.asList(
            "/h5/login"
            );

    /**
     * 一千
     */
    public static final BigDecimal THOUSAND = new BigDecimal("1000");

    /**
     * xxl-job的app名称
     */
    public static final String XXL_JOB_APP_NAME = "gmp";

    /**
     * xxl-job的执行bean名称
     */
    public static final String XXL_JOB_BEAN_NAME = "deviceSwitch";

    /**
     * 公众号相关
     */
    public static final class OfficialAccount {

        public static final String appId = "wxfa93c8cdda762836";

        public static final String appSecret = "e7e719ba4d9a9d8323ae85d7646d1514";

        public static final String token = "dms";

        public static final String encodingAESKey = "E7xRQY1S3ZV5wpBCWNiUGRtSFTBgxgxzJJaDGji0Uqw";
    }


    /**
     * 缓存常量类
     */
    public static final class Redis {



        public static final String RFID_AIO = "RFID_AIO_KEY";
        public static final String RFID_RECONNECT = "RFID_RECONNECT_KEY";//重新连接设备的

        /**
         * 后台管理用户登录token信息,如：{userno}:login:token
         */
        public static final String USER_LOGIN_TOKEN = "%s%s:login:token";


        public static final String QRCODE_KEY = "%s:qrcode:key";


        /**
         * 生成token的后台管理用户信息，如：{token}:login:user
         */
        public static final String TOKEN_LOGIN_USER = "%s:login:user";

        /**
         * 后台管理用户登录token信息,如：{userno}:login:token
         */
        public static final String APP_USER_LOGIN_TOKEN = "%s%s:login:app:token";
        public static final String H5_USER_LOGIN_TOKEN = "%s%s:login:app:token";

        /**
         * 生成token的后台管理用户信息，如：{token}:login:user
         */
        public static final String APP_TOKEN_LOGIN_USER = "%s:login:app:user";
        public static final String H5_TOKEN_LOGIN_USER = "%s:login:app:user";

        /**
         * 公众号的token的key
         */
        public static final String OFFICIAL_ACCOUNTS_TOKEN_KEY = "gmp:official:accounts:access:token";

        /**
         * 设备激活的key，用ID替换
         */
        public static final String DEVICE_ACTIVATION_KEY = "dms:device:activation:%s";

    }

}
